import request from '@/utils/request'

// 获取所有角色列表
export const getRolesInfo = (params) => {
  return request.get('/roles', { params })
}

// 获取角色列表的数量
export const getRoleCount = () => {
  return request.get('/roles/count')
}

// 添加角色列表
export const addRolesInfo = (data) => {
  return request.post('/roles', data)
}

// 根据id获取指定角色
export const byIdRelosInfo = (id) => {
  return request.get(`/roles/${id}`)
}

// 更新角色信息
export const updateRoleInfo = (data) => {
  return request.put(`/roles/${data.id}`, data)
}

// 删除角色信息
export const delRoleInfo = (id) => {
  return request.delete(`/roles/${id}`)
}

// 获取所有权限
export const getPermissions = () => {
  return request.get('/permissions')
}
